#!/bin/bash



# SCRIPT FEITO POR PX, PARA OUVIR RADIOS SIMPLESMENTE USANDO O MPLAYER E SHELL SCRIPT
# ADCIONADO FUNÇÃO PARA STREAM PELO RTMPDUMP, AGORA E POSIVEL VER TV
# OS LINKS SÃO DE SERVIDORES, PODEM FICAR OFFLINE APOS ALGUM TEMPO
# QUALQUER UM PODE ALTERAR OU ADICIONAR LINKS AO SCRIPT, BASTA MANTER ESTES CREDITOS
# OBG E BOM PROVEITO!
# CONTATO POR dropx11@gmail.com

# lista de drivers de saida de video
#
# Available video output drivers:
#	vdpau	VDPAU with X11
#	xv	X11/Xv
#	gl_nosw	OpenGL no software rendering
#	x11	X11 ( XImage/Shm )
#       drm     fb com video
#	xover	General X11 driver for overlay capable video output drivers
#	sdl	SDL YUV/RGB/BGR renderer (SDL v1.1.7+ only!)
#	gl	OpenGL
#	gl_sdl	OpenGL with SDL
#	dga	DGA ( Direct Graphic Access V2.0 )
#	fbdev	Framebuffer Device
#	fbdev2	Framebuffer Device
#	aa	AAlib
#	caca	libcaca
#	v4l2	V4L2 MPEG Video Decoder Output
#	dfbmga	DirectFB / Matrox G200/G400/G450/G550
#	null	Null video output
#	directfb	Direct Framebuffer Device
#	mpegpes	MPEG-PES to DVB card
#	yuv4mpeg	yuv4mpeg output for mjpegtools
#	png	PNG file
#	jpeg	JPEG file
#	gif89a	animated GIF output
#	tga	Targa output
#	pnm	PPM/PGM/PGMYUV file
#	md5sum	md5sum of each frame



# drivers de saida de video
DRIVER=x11

# Player
#PLAYER="cvlc --vout $DRIVER"
PLAYER="mpv --volume=90 -vo=$DRIVER"
#PLAYER2="mpv --volume=90 -vo=$DRIVER"
PLAYER2="cvlc --vout=$DRIVER"
PLAYER3="mplayer -vo $DRIVER"
PLAYER4="mpv --no-video"

# canais
ALLSPORTS="https://5cf4a2c2512a2.streamlock.net/dgrau/dgrau/chunklist.m3u8"

SBT3="http://wz4.dnip.com.br/bemtv/bemtv.sdp/playlist.m3u8"

AGROBRASIL="http://45.162.230.234:1935/agrobrasiltv/agrobrasiltv/playlist.m3u8"

RECORDNEWS="http://playplusnews-lh.akamaihd.net/i/pp_nws@377849/index_360_av-p.m3u8?PEDROJUNIORTUTORIAIS"

RBC="http://rbc.directradios.com:1935/rbc/rbc/live.m3u8"

COMBRASIL="https://596639ebdd89b.streamlock.net/8032/8032/index.m3u8"

ANIMETV="https://stmv1.srvif.com/animetv/animetv/playlist.m3u8"

ISTV="https://cdn.jmvstream.com/w/LVW-9883/LVW9883_lFcfKysrHF/chunklist.m3u8"

TVCAMARA="https://stream3.camara.gov.br/tv1/manifest.m3u8"

REDEBRASIL="https://59f2354c05961.streamlock.net:1443/rbtv/rbtv/playlist.m3u8"

FUTURA="https://tv.unisc.br/hls/test.m3u8"

TVERS="http://selpro1348.procergs.com.br:1935/tve/stve/playlist.m3u8"

BANDPA="https://5cf4a2c2512a2.streamlock.net/rbatv/rbatv/playlist.m3u8?PEDROJUNIORTUTORIAIS"

BAND="http://evpp.mm.uol.com.br:1935/geob_band/app/playlist.m3u8?PEDROJUNIORTUTORIAIS"

TVCULTURA="https://5b33b873179a2.streamlock.net:1443/live/livestream/playlist.m3u8?PEDROJUNIORTUTORIAIS"




PRINCIPAL() {
clear

echo "--------------------------------------"
echo "OPÇÕES:"
echo
echo "1. Menu de Radios"
echo "2. Menu de TV"
echo "3. Menu de Shows live"
echo "4. Sair..."
echo 
echo "--------------------------------------"

read opcao

case $opcao in

1) Radio ;;

2) TV ;;

3) show ;;

4) EXIT ;;

*) "erro entrada invalida." ; echo ; PRINCIPAL ;;
esac

}


Radio() {
clear

echo "--------------------------------------"
echo "RADIOS:"
echo
echo  1 : Radio Rock
echo  2 : Radio Senado
echo  3 : Radio Reggae
echo  4 : Radio Eletronica
echo  5 : Radio Cbn RE
echo  6 : Radio Slackjeff
echo  7 : Radio Pop Rock
echo  8 : Radio forro
echo  9 : Radio Pagode
echo  10 : Radio Sertanejo
echo  11 : Raido Anos 80
echo  12 : Radio Anos 90
echo  13 : Radio Anos 2000
echo " 			  - : Voltar"
echo "			  * : Sair..."
echo "--------------------------------------"

echo


read radio


if [ "$radio" = "1" ]; then
$PLAYER2 "https://stream.vagalume.fm/hls/1464201608479108132/aac.m3u8"

Radio

fi

if [ "$radio" = "2" ]; then
$PLAYER2 "https://www12.senado.leg.br/radiosenado/canal2aac/playlist.m3u8"

Radio

fi

if [ "$radio" = "3" ]; then
$PLAYER2 "https://stream.vagalume.fm/hls/1465840912218182609/aac.m3u8"

Radio

fi

if [ "$radio" = "4" ]; then
$PLAYER2 "https://stream.vagalume.fm/hls/146411300413492499/aac.m3u8"

Radio

fi


if [ "$radio" = "5" ]; then
$PLAYER2 "https://59f1cbe63db89.streamlock.net:1443/asabrancaradio/_definst_/asabrancaradio/playlist.m3u8"

Radio

fi


if [ "$radio" = "6" ]; then
$PLAYER2 "https://radio.slackjeff.com.br/play"

Radio

fi

if [ "$radio" = "7" ]; then
$PLAYER2 "https://stream.vagalume.fm/hls/1506975770142563/aac.m3u8"

Radio

fi

if [ "$radio" = "8" ]; then
$PLAYER2 "https://stream.vagalume.fm/hls/147015501223418/aac.m3u8"

Radio

fi

if [ "$radio" = "9" ]; then
$PLAYER2 "https://stream.vagalume.fm/hls/147015499779090/aac.m3u8"

Radio

fi


if [ "$radio" = "10" ]; then                                                          $PLAYER2 "https://stream.vagalume.fm/hls/14619606471054026608/aac.m3u8"
										      Radio

fi

if [ "$radio" = "11" ]; then
$PLAYER2 "https://stream.vagalume.fm/hls/1507663468882713/aac.m3u8"
    
Radio

fi

if [ "$radio" = "12" ]; then
$PLAYER2 "https://stream.vagalume.fm/hls/1478022035646498/aac.m3u8"

Radio

fi

if [ "$radio" = "13" ]; then
$PLAYER2 "https://stream.vagalume.fm/hls/147396460892793/aac.m3u8"

Radio

fi


#funções do menu

if [ "$radio" = "-" ]; then

PRINCIPAL

fi

if [ "$radio" = "*" ]; then

EXIT

fi

}

TV() {
clear

echo "--------------------------------------"
echo "CANAIS:"
echo
echo  1 : All Sports
echo  2 : SBT 3
echo  3 : Agro Brasil
echo  4 : Record News
echo  5 : RBC
echo  6 : COM Brasil
echo  7 : Record news
echo  8 : SBT
echo  9 : Anime TV
echo  10 : ISTV
echo  11 : TV camara
echo  12 : Rede Brasil
echo  13 : Canal Futura
echo  14 : TVE RS
echo  15 : Band PA
echo  16 : Band
echo  17 : TV Cultura PR
echo " 			  - : Voltar"
echo "			  * : Sair..."
echo "--------------------------------------"

read tv

if [ "$tv" = "1" ]; then
$PLAYER $ALLSPORTS  
TV

fi

if [ "$tv" = "2" ]; then
$PLAYER $SBT3 
TV

fi

if [ "$tv" = "3" ]; then
$PLAYER $AGROBRASIL 
TV

fi

if [ "$tv" = "4" ]; then
$PLAYER $RECORDNEWS
TV

fi

if [ "$tv" = "5" ]; then
$PLAYER $RBC
TV

fi

if [ "$tv" = "6" ]; then
$PLAYER $COMBRASIL 
TV

fi

if [ "$tv" = "7" ]; then
$PLAYER $RECORDNEWS
TV

fi

if [ "$tv" = "8" ]; then
$PLAYER $SBT
TV

fi

if [ "$tv" = "9" ]; then
$PLAYER $ANIMETV 
TV

fi

if [ "$tv" = "10" ]; then
$PLAYER $ISTV 
TV

fi

if [ "$tv" = "11" ]; then
$PLAYER $TVCAMARA 
TV

fi

if [ "$tv" = "12" ]; then
$PLAYER $REDEBRASIL 
TV

fi

if [ "$tv" = "13" ]; then
$PLAYER $FUTURA 
TV

fi

if [ "$tv" = "14" ]; then
$PLAYER $TVERS
TV

fi

if [ "$tv" = "15" ]; then
$PLAYER $BANDPA 
TV

fi

if [ "$tv" = "16" ]; then
$PLAYER $BAND 
TV

fi

if [ "$tv" = "17" ]; then
$PLAYER $TVCULTURA 
TV

fi


#funções do menu

if [ "$tv" = "-" ]; then
PRINCIPAL

fi

if [ "$tv" = "*" ]; then
EXIT

fi


}



show() {
clear

echo "--------------------------------------"
echo "show:"
echo
echo  1 : Show live Red hot 1
echo  2 : Show live Red hot 2
echo  3 : Show live Pearl jam
echo  4 : Show live Foo fighters
echo  5 : Show live AC/DC
echo " 			  - : Voltar"
echo "			  * : Sair..."
echo "--------------------------------------"

echo


read show 




if [ "$show" = "1" ]; then
$PLAYER4 "https://youtu.be/1_HkEMasarg"

show

fi
   

if [ "$show" = "2" ]; then
$PLAYER4 "https://youtu.be/FmrGz8qSyrk"

show

fi

if [ "$show" = "3" ]; then
$PLAYER4 "https://youtu.be/O-KtHlrzHbU"

show

fi



if [ "$show" = "4" ]; then
$PLAYER4 "https://youtu.be/TeTT1o5RzlE"

show

fi



if [ "$show" = "5" ]; then
$PLAYER4 "https://youtu.be/7uauVGvTF-8"

show

fi


#funções do menu

if [ "$show" = "-" ]; then

PRINCIPAL

fi

if [ "$show" = "*" ]; then

EXIT

fi

}




EXIT() {
clear
echo "Obrigado por usar este script!"
sleep 2
clear
echo "Até mais"
sleep 1
clear
exit

}

PRINCIPAL
